home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Die Speccy' 97
/
Die Speccy' 97.iso
/
amiga_system
/
the_aminet
/
comm
/
bbs
/
trinitybbs20.lha
/
OLP
/
tradewars.lzh
/
twmain
< prev
next >
Wrap
Text File
|
1992-05-23
|
44KB
|
2,303 lines
/* Tradewars Amiga mainfile
By Jim Holzknecht */
options results
omem=storage()
getuser 1
name=result
getuser 27
linelength=result
getuser 41
serialn=result
getuser 17
maint=result
PF='olp:TRADEWARS/'
PFP='olp:TRADEWARS/players/'
PFU='olp:TRADEWARS/universe/'
PFT='olp:TRADEWARS/teams/'
PFW='olp:TRADEWARS/planets/'
date=date('U')
sector=0
turns=0
signal on error
signal on syntax
signal on ioerr
filen=PF'autodata.tw'
call open file, (filen), 'R'
do x=1 to 7
am.x=readln(file)
end
call close file
filen=PF'unidata.tw'
call open file, (filen), 'R'
ns=readln(file)
cbs=readln(file)
call close file
filen=PF'var.tw'
call open file, (filen), 'R'
c.1=readln(file)
c.2=readln(file)
call close file
if exists(PF'errlog') then do
logentry '\z7\c0Tradewars ran under error conditions. Check errlog.\z0\q1'
end
transmit '\n2\c6Tradewars Version \c21.05d (*Release*)'
transmit '\n1\c6Initializing\c1...'
ur=0
x=0
yoop:
x=x+1
if x >40 then signal yoopa
user=PFP'p' x
call open file, (user), 'R'
do y=1 to 15
pl.x.y=readln(file)
end
call close file
signal yoop
yoopa:
x=0
usersearch:
x=x+1
if x=41 then do
ur=0
signal usersearcha
end
if pl.x.15=serialn then do
ur=x
if pl.x.1 ~= name then do
transmit '\c7\n1Name change noted...'
pl.x.1=name
end
signal usersearcha
end
signal usersearch
usersearcha:
if ur=0 then signal twnew
if pl.ur.4=0 & pl.ur.14=date('c') then do
transmit '\n1\c2You just died today. You will get a new ship tomorrow.'
signal end
end
if pl.ur.4=0 then signal twnew
twstart:
if ur=0 then signal end
pl.ur.15=serialn
transmit '\n1\c7*** \c5'ns' sectors! GOOD LUCK! \c7***'
transmit '\n1\c1Welcome 'name'!!!'
transmit '\n1\c4The following happened to your ship since your last time on:\c3'
number=ur
if exists(PF''number) then do
sendfile PF''number
address command 'delete 'PF''number
signal twstarta
end
transmit 'Nothing...'
twstarta:
a=pl.ur.1' ['pl.ur.2'] Logged on: 'date' / 'time()
call newspaperopen
twstartc:
if pl.ur.6=date then transmit '\n1\c2You have been on today.'
turns=pl.ur.5
if pl.ur.6 ~= date then turns=am.7
transmit '\n1\c6You have \c1'turns' \c6turns remaining.'
if turns=0 then do
transmit '\n1\c2Sorry, you have no turns!'
signal end
end
call twlotto
hom:
transmit '\n1\c7Checking for messages sent to you\c1...\c3'
x=0
filen=PF'1ALL.msg';call mesr
filen=PF'2ALL.msg';call mesr
filen=PF'3ALL.msg';call mesr
filen=PF''ur'.msg';x=1;call mesr
signal hom2
mesr:
if exists(filen) then do
sendfile filen
if x=1 then do
address command 'delete 'filen
end
end
return
hom2:
sector=pl.ur.4
call ds
signal mainmenu
end0:
sendstring '\n1\c5Are you sure [\c1Y\c5/\c1n\c5]? \c3'
call ask
if an='N' then signal mainmenu
transmit '\n1\c6Saving\c1...'
end2:
user=PFP'p' ur
pl.ur.4=sector
pl.ur.5=turns
pl.ur.6=date('U')
pl.ur.14=date('C')
pl.ur.15=serialn
call open file, (user), 'W'
do x=1 to 15
call writeln file, pl.ur.x
end
call close file
end:
exit
twnew:
transmit '\n1\c5Building A Ship For You\c1...'
if ur>0 then signal parta
ur=0
x=0
checklist:
x=x+1
if x>41 then do
ur=0
signal build
end
if left(pl.x.1,1)="." then do
ur=x
signal build
end
signal checklist
build:
if ur=0 then do
transmit '\n1\c2There is no room for the likes of you.'
transmit '(try again later)'
signal twstart
end
pl.ur.1=name
pl.ur.2='0'
pl.ur.6='0'
pl.ur.13='0'
parta:
pl.ur.3='200'
pl.ur.4='1'
pl.ur.5=am.7
pl.ur.7='20'
pl.ur.8='0'
pl.ur.9='0'
pl.ur.10='0'
pl.ur.11='0'
pl.ur.12='1000'
signal twstart
key:
bufferflush
sendstring '\c6(\c1-*Press Any Key*-\c6)\c3'
getchar
transmit '\h9\h7\h7'
return
error:
a=SIGL
transmit '\n1Error in Line #'a
an='-- Error; Line #'a'\n1 'pl.ur.1
signal errorlog
syntax:
a=SIGL
transmit '\n1Syntax Error In Line #'a
an=sourceline(a)
transmit 'Line Reads : >'an'<'
an='-- Syntax Error; Line #'a'\n1 >'sourceline(a)'<\n1 'pl.ur.1||' 'sector
signal errorlog
errorlog:
if ~exists(PF'errlog') then do
call open file, (PF'errlog'), 'W'
call writeln file, an
call close file
bbscommand 'F'
signal end
end
call open file, (PF'errlog'), 'A'
call writeln file, an
call close file
bbscommand 'F'
signal end
ioerr:
a=SIGL
transmit '\n1I/O Error In Line #'a
an='-- I/O Error; Line #'a'\n1 'pl.ur.1
signal errorlog
newspaperopen:
if exists(PF'paper.tw') then do
call close file
call open file, (PF'paper.tw'), 'A'
call writeln file, a
call close file
drop a
return
end
call close file
call open file, (PF'paper.tw'), 'W'
call writeln file, a
call close file
drop a
return
sectordata:
uni=PFU'tws'sector
call close file
call open file, (uni), 'R'
do i=1 to 26
sd.i=readln(file)
end
call close file
sdt.1=trim(sd.1)
upper sdt.1
if left(sd.1,1)='.' then sdt.1='None'
if sdt.1='None' then sdt.2=''
if sdt.1 ~= 'None' then do
sdt.2=', class 'sd.2
sdt.1=sdt.1''sdt.2
end
sdt.3=sd.3
if sd.3=0 then sdt.3=''
sdt.4=sd.4
if sd.4=0 then sdt.4=''
sdt.5=sd.5
if sd.5=0 then sdt.5=''
sdt.6=sd.6
if sd.6=0 then sdt.6=''
sdt.21=sd.21
if sd.21=0 then sdt.21=''
sdt.22=sd.22
if sd.22=0 then sdt.22=''
return
ds:
call sectordata
transmit '\n1\c2Sector : 'sector
transmit '\c4Port : 'sdt.1
if left(sd.26,2) ~= '..' & sd.26 ~= '' then transmit '\c7Planet : 'sd.26
sendstring '\c3Ships : '
nf=0
do x=1 to 40
if pl.x.4=sector then do
if x ~= ur then do
nf=1
sendstring '\n1 'pl.x.1
if pl.x.2>0 then do
sendstring ' Team ['pl.x.2']'
end
sendstring ' with 'pl.x.3' fighters'
end
end
end
if nf=0 then sendstring 'None'
sendstring '\n1\c5Fighters: '
if sd.8>0 then do
sendstring sd.8' belonging to '
y=sd.9
if sd.9=99 then sendstring 'the Cabal'
if sd.9 ~= 99 then sendstring pl.y.1
if pl.y.2>0 then do
if sd.9 ~= 99 then sendstring ' ['pl.y.2']'
end
transmit ''
end
if sd.8=0 then transmit 'None'
sendstring '\c7Warps : 'sdt.3
if sdt.4 ~= '' then sendstring ', 'sdt.4
if sdt.5 ~= '' then sendstring ', 'sdt.5
if sdt.6 ~= '' then sendstring ', 'sdt.6
if sdt.21 ~= '' then sendstring ', 'sdt.21
if sdt.22 ~= '' then sendstring ', 'sdt.22
if sd.16>0 then do
sendstring '\n1\c1<\c2Mine In This Sector\c1>'
end
transmit '\n1'
return
mainmenu:
sendstring '\c4Main Command (A,B,C,D,F,G,I,L,M,P,Q,S,T,Z,?)? \c1'
call ask
if an='Q' then signal end0
if an='A' then signal attack
if an='B' then signal bank
if an='C' then signal computer
if an='D' then do
call ds
signal mainmenu
end
if an='F' then signal fighters
if an='G' then signal gamble
if an='I' then signal information
if an='L' then signal land
if an='M' then do
if turns=0 then do
transmit '\n1\c2Sorry, you have no more turns left!'
signal mainmenu
end
signal move
end
if an='P' then do
if turns=0 then do
transmit '\n1\c2Sorry, you have no more turns left!'
signal mainmenu
end
signal port
end
if an='#' then signal mi
if an='S' then signal mine
if an='T' then signal team
if an='Z' then do
sendfile PF'tw.help'
signal mainmenu
end
if an="?" then do
sendfile PF'main.help'
signal mainmenu
end
signal mainmenu
mi:
transmit '\f1Bytes free when Tradewars was begun were' omem
an=storage()
transmit 'There are' an ' bytes available now.'
an=omem-an
transmit 'Tradewars is using' an ' bytes.'
signal mainmenu
twlotto:
if pl.ur.6=date then return
transmit '\n1\c5Do you wish to play the intergalactic pick 4 lottery?'
aks='\c4A ticket costs 10 credits (\c7Y\c4/\c7n\c4)? \c1'
call askq
upper an
if an='N' then return
if pl.ur.12<10 then do
transmit '\n1\c2You do not have enough money!'
return
end
pl.ur.12=pl.ur.12-10
getlotnum:
aks='\n1\c2What is your four digit number for the lottery computer? \c1'
call askq
len=length(an)
if len <4 then signal getlotnum
an=left(an,4)
transmit '\n1\c6Working\c1...'
rn=random(1,9,time('s'))
a=rn
rn=random(1,9,time('s'))
bo=rn
rn=random(1,9,time('s'))
c=rn
rn=random(1,9,time('s'))
d=rn
transmit '\n1\c5The Galactic Lottery Computer picked \c7'a''bo''c''d'\c5.'
x=0
z=0
fruitloop:
z=z+1
if z=5 then signal check
y=substr(an,z,1)
if y=a then do
x=x+1
a=99
signal fruitloop
end
if y=bo then do
x=x+1
b=99
signal fruitloop
end
if y=c then do
x=x+1
c=99
signal fruitloop
end
if y=d then do
x=x+1
d=99
signal fruitloop
end
signal fruitloop
check:
transmit '\n1\c1You matched\c2' x '\c1digits.'
if x=0 then y=0
if x=1 then y=50
if x=2 then y=5000
if x=3 then y=15000
if x=4 then y=50000
pl.ur.12=pl.ur.12+y
transmit '\n1\c3You won \c1'y' \c3credits giving you a total of \c1'pl.ur.12' \c3credits!'
if y>50 then do
a=pl.ur.1' won 'y' credits in the lottery.'
call newspaperopen
end
drop a bo c d x y rn
signal hom
ws:
call open file, (PFU'tws'sector), "W"
do yop=1 to 26
call writeln file, sd.yop
end
call close file
drop yop
return
saveuser:
call open file, (PFP'p' x), 'W'
do yup=1 to 15
call writeln file, pl.x.yup
end
call close file
drop yup
return
hapopen:
number=x
filename=PF''number
if exists(filename) then do
call open file, (filename), 'A'
call writeln file, hap
call close file
return
end
call open file, ('olp:TRADEWARS/'number), 'W'
call writeln file, hap
call close file
drop hap
return
move:
transmit ''
if ape=1 then signal moveit
sendstring '\c1Warps lead to 'sdt.3
if sdt.4 ~= '' then sendstring ', 'sdt.4
if sdt.5 ~= '' then sendstring ', 'sdt.5
if sdt.6 ~= '' then sendstring ', 'sdt.6
if sdt.21 ~= '' then sendstring ', 'sdt.21
if sdt.22 ~= '' then sendstring ', 'sdt.22
aks = '\n1\c3Move To? \c7'
call askq
an=strip(an)
if left(an,1)='0' then signal mainmenu
if an='' then signal mainmenu
if an=0 then an=1000000
if cs=1 then do
call ws
cs=0
end
moveit:
if an=sdt.3 | an=sdt.4 | an=sdt.5 | an=sdt.6 | an=sdt.21 | an=sdt.22 then do
ls=sector
sector=an
turns=turns-1
call ds
if sd.8>0 then do
call fightercheck
if x=1 then signal attackf
end
if sd.16>0 then do
call minecheck
if x=1 then signal mineexp
end
signal mainmenu
end
transmit '\n1\c2You cannot move there now!'
signal mainmenu
information:
transmit '\f1\c1Ship information:'
transmit "\n1 Pilot's Name: "pl.ur.1
transmit " Team: "pl.ur.2
transmit " Fighters: "pl.ur.3
transmit " Sector Location: "sector
transmit " Turns Left: "turns
transmit " Cargo Holds: "pl.ur.7
transmit " Holds Status: "
transmit " # with Ore: "pl.ur.8
transmit " # with Org: "pl.ur.9
transmit " # with Eqp: "pl.ur.10
transmit " Sector Mines: "pl.ur.11
transmit " Trading Credits: "pl.ur.12
transmit " Bank Credits: "pl.ur.13
call key
signal mainmenu
gamble:
transmit '\c3You have a 50-50 chance of winning twice the amount you bet.'
transmit 'You have 'pl.ur.12' credits that you can gamble.'
aks='Bet how much [0]? '
call askq
an=compress(an)
if an='' then signal mainmenu
y=pl.ur.12
x=random(1,2,time('s'))
z=an
if z<=0 then signal gamble
if z>y then signal gamble
if x>1 then do
y=y-z
z=z*2
transmit '\n1You Won 'z' Credits!'
y=y+z
transmit 'You now have 'y' credits.'
pl.ur.12=y
signal mainmenu
end
transmit '\n1You Lost!'
y=y-z
transmit 'You have 'y' credits.'
pl.ur.12=y
signal mainmenu
fightercheck:
if sd.9=ur then do
x=0
return
end
tnu=sd.9
y=pl.tnu.2
if y=0 then do
x=1
return
end
if sd.9>0 then do
if y=pl.ur.2 then do
x=0
return
end
end
x=1
return
minecheck:
tnu=sd.17
if sd.17=ur then do
x=0
return
end
y=pl.tnu.2
if sd.17>0 then do
if y=pl.ur.2 then do
x=0
return
end
end
x=1
return
bank:
transmit '\f1\c5'
an='Welcome to the'
call cnter
an='FIRST INTERGALACTIC BANK'
call cnter
an='Auto-Transactor'
call cnter
an='----------------------------'
call cnter
bank2:
transmit " Today's interest rate is "c.1"%"
transmit '\n1Trading Credits: 'pl.ur.12
transmit 'Banking Credits: 'pl.ur.13
transmit '\n1\c11\c5) Exit The Bank'
transmit '\c12\c5) Deposit Credits'
transmit '\c13\c5) Withdraw Credits (15% service charge)'
sendstring '\n1Auto-Transactor Command (1,2,3)? '
call ask
if an=1 then signal mainmenu
if an=2 then signal deposit
if an=3 then signal withdraw
signal bank2
deposit:
aks='You have 'pl.ur.12' credits. Deposit how many [0]? '
call askq
if an='' then signal bank2
if an>pl.ur.12 then signal deposit
if an<0 then signal deposit
x=pl.ur.13
y=an
x=x+y
pl.ur.13=x
x=pl.ur.12
x=x-y
pl.ur.12=x
signal bank2
withdraw:
aks='\n1You have 'pl.ur.13' bank credits. Withdraw how many [0]? '
call askq
if an='' then signal bank2
if an>pl.ur.13 then signal withdraw
if an<0 then signal withdraw
x=an
y=pl.ur.13
z=trunc(.15 * x)
if x+z>y then do
transmit '\n1Not enough left over for service charge, please enter a new figure'
signal withdraw
end
y=y-(x+z)
pl.ur.13=y
y=pl.ur.12
y=y+x
pl.ur.12=y
transmit '\n1'z' credits taken for service charge.'
signal bank2
cnter:
sendstring center(an,linelength)
return
fighters:
transmit ''
if sector=1 then do
transmit 'No dropped fighters in sector 1!'
signal mainmenu
end
temp=sd.9
teamnumber=pl.temp.2
if teamnumber=0 then teamnumber=99
if sd.8>0 and pl.ur.2=teamnumber then signal fighters2
if sd.8>0 & sd.9 ~= ur then do
transmit '\c2You cannot drop your own fighters here!'
signal mainmenu
end
fighters2:
x=sd.8
if sd.9=ur | pl.ur.2=teamnumber then do
transmit 'Fighters Here:' x
signal pickup
end
drop:
transmit '\n1\c6You have \c1'pl.ur.3'\c6 fighters.'
aks='\c3How many fighters do you wish to drop [\c10\c3]? \c7'
call askq
if an='' | an=0 then signal mainmenu
if an>pl.ur.3 then do
transmit '\n1\c2You do not have 'an' fighters!'
signal fighters
end
if an<0 then do
transmit '\n1\c2Get Real!'
signal fighters
end
y=pl.ur.3
y=y-an
pl.ur.3=y
sd.8=an
x=ur
sd.9=x
call ws
if ~exists(PFU'fighters') then do
call open file, (PFU'fighters'), 'W'
call writeln file, ''
call close file
end
call open file, (PFU'fighters'), 'A'
an = serialn||' '||sector||' 'sd.8
call writeln file, an
call close file
transmit '\n1\c4Dropped.'
signal mainmenu
pickup:
y=pl.ur.3
y=y+x
pl.ur.3=y
sd.8=0
sd.9=0
call ws
transmit '\n1\c4All Fighters Collected'
call ldftr
searchun:
x=0
searchun2:
x=x+1
if x>y then signal mainmenu
if sector = word(pd.x,2) then signal removef
signal searchun2
removef:
z=0
removef2:
z=z+1
temp=y+1
if z=temp then signal removef3
temp=x+z
an=x+z-1
pd.an=pd.temp
signal removef2
removef3:
y=y-2
call open file, (PFU'fighters'), 'W'
do z=1 to y
call writeln file, pd.z
end
call close file
drop pd
signal mainmenu
attack:
transmit '\n1\c6[\c1Attack Another Player\c6]'
x=0
attack1:
x=x+1
if x=41 then do
transmit '\n1\c2No one To Fight.'
signal mainmenu
end
if pl.x.4=sector & x ~= ur then do
aks='\n1\c3Attack 'trim(pl.x.1)' ('pl.x.3' Fighters) [\c1N\c3]? \c7'
call askq
upper an
if an='Y' then signal attack2
end
signal attack1
attack2:
if pl.x.2=pl.ur.2 & pl.ur.2 ~= 0 then do
transmit '\n1\c2You traitor, you cannot attack your own team members!'
signal mainmenu
end
transmit '\n1\c5You have 'pl.ur.3' fighters.'
aks='\c4Use how many fighters [\c10\c4]? \c7'
call askq
upper an
if an='' then signal mainmenu
transmit '\c6Attacking\c1!'
f=0
a=an
bo=pl.x.3
z=pl.ur.3
if a<1 | a>pl.ur.3 then signal attack2
bo=pl.x.3
if pl.ur.3=0 then signal dead
z=z-a
pl.ur.3=z
attackloop:
do until a<1 | bo<1
c = random(0,1,time('s'))
if c=0 then a=a-1
if c=1 then do
bo=bo-1
f=f+1
end
if a<=0 then do
transmit '\n1\c2You lost your fighters!'
signal finishup
end
if bo<=0 then do
transmit '\n1\c5You won!'
signal winner
end
end
winner:
z=pl.ur.3
z=z+a
pl.ur.3=z
z=pl.ur.7
y=random(0,pl.x.7,time('s'))
z=z+y
if z>60 then z=60
pl.ur.7=z
transmit '\n1\c4You managed to salvage \c1'y' \c4holds.'
z=pl.ur.12
y=pl.x.12
z=z+y
pl.ur.12=z
transmit '\n1\c1You collected \c4'y' \c1credits.'
pl.x.3=0
pl.x.4=0
pl.x.7=0
call saveuser
hap=trim(pl.ur.1)' killed you.'
call hapopen
fudge:
a=trim(pl.ur.1)' killed 'trim(pl.x.1)
call newspaperopen
signal mainmenu
finishup:
pl.x.3=bo
call saveuser
hap=strip(pl.ur.1)' destroyed 'f' of your fighters.'
call hapopen
if pl.ur.3=0 then do
transmit 'You have no more fighters to protect you...'
signal dead
end
signal mainmenu
mine:
transmit '\n1\c1[\c2Drop Sector Mine\c1]'
if sd.16>0 then do
transmit '\n1\c4One is enough for now!'
signal mainmenu
end
if pl.ur.11=0 then do
transmit '\n1\c2Try buying one first!'
signal mainmenu
end
if sector=1 then do
transmit '\n1\c5No, not quite fair to put it here!'
signal mainmenu
end
x=sd.2
if x=0 & left(sdt.1,4) ~= 'None' then do
transmit '\n1\c4Are you crazy? People have a right to fly here too!'
signal mainmenu
end
x=pl.ur.11
x=x-1
pl.ur.11=x
if pl.ur.2>0 then do
transmit '\n1\c5This will be a team mine.'
signal secnext
end
secnext:
sd.17=ur
sd.16=1
call ws
transmit '\n1\c7Mine dropped in sector \c3'sector'\c7.'
a=trim(pl.ur.1)' dropped a mine somewhere!'
call newspaperopen
signal mainmenu
mineexp:
x=random(0,2,time('s'))
if x=1 then do
transmit '\n1\c1You are lucky that mine was a dud!'
signal mend
end
transmit '\n1\c4Uh-Oh! ... B O O M !'
transmit '\n1\c4You just lost 1/2 your cargo and 10% of your holds!'
x=pl.ur.8
x=x/2
pl.ur.8=x%1
x=pl.ur.9
x=x/2
pl.ur.9=x%1
x=pl.ur.10
x=x/2
pl.ur.10=x%1
x=pl.ur.7*0.1
x=x%1
y=pl.ur.7
y=y-x
pl.ur.7=y
mend:
sd.16=0
sd.17=0
call ws
signal mainmenu
computer:
transmit '\n1\c6[\c1Computer Activated\c6]'
computermain:
sendstring '\n1\c4Computer Command (F,G,M,P,Q,R,S,?)? \c7'
call ask
upper an
if an='' then signal computermain
if an='Q' then do
transmit '\n1\c6[\c1Computer Deactivated\c6]'
call ds
signal mainmenu
end
if an='P' then signal preport
if an='R' then signal rankplay
if an='M' then signal sendmessage
if an='G' then signal newspaper
if an='F' then signal findfight
if an='S' then signal scan
if an='?' then do
sendfile PF'computer.help'
signal computermain
end
signal computermain
newspaper:
transmit '\n1\c1[\c5Read Galactic Newspaper\c1]\c3'
sendfile PF'paper.tw'
signal computermain
preport:
aks='\c6What sector number is the port in? \c1'
call askq
if an='' | an=0 then signal computermain
if an<0 | an>ns then signal computermain
x=an
if x<1 or x>ns then do
transmit '\n1\c2Idiot!'
signal computermain
end
xon=sector
sector=x
call sectordata
if upper(sdt.1)='NONE' then do
transmit "\n1\c5If there is a port in that sector, I don't know about it!"
sector=xon
call sectordata
signal computermain
end
transmit '\c1Commerce report for 'sdt.1''date()
z=sd.2
if z=0 then signal class0
transmit ''
call portstat
signal commend
class0:
transmit '\c5Cargo Holds \c2: \c1'sd.19' \c5credits/hold'
transmit '\c5Fighters \c2: \c1'sd.18' \c5credits/fighter'
transmit '\c5Turns \c2: \c1'sd.20' \c5credits/turn'
transmit '\c5Mines \c2: \c14,000 \c5credits each'
commend:
sector=xon
call sectordata
signal computermain
portstat:
x=sd.2
z=1
if x=1 then do
if left(sd.23,1)='.' then do
sd.12=1000;sd.14=1000
end
tt.1='Selling';y=sd.10;call change;sd.10=y
tt.2='Buying ';y=sd.12;call change2;sd.12=y
tt.3='Buying ';y=sd.14;call change2;sd.14=y
end
x=sd.2
if x=2 then do
if left(sd.23,1)='.' then do
sd.10=1000;sd.14=1000
end
tt.1='Buying ';y=sd.10;call change2;sd.10=y
tt.2='Selling';y=sd.12;call change;sd.12=y
tt.3='Buying ';y=sd.14;call change2;sd.14=y
end
x=sd.2
if x=3 then do
if left(sd.23,1)='.' then do
sd.10=1000;sd.12=1000
end
tt.1='Buying ';y=sd.10;call change2;sd.10=y
tt.2='Buying ';y=sd.12;call change2;sd.12=y
tt.3='Selling';y=sd.14;call change;sd.14=y
end
tt.4=sd.10
tt.5=sd.12
tt.6=sd.14
sd.23=date()
call ws
transmit '\n1\c3Type Status #'
transmit '\c1========================'
transmit '\c7Organics 'tt.1' 'tt.4
transmit 'Ore 'tt.2' 'tt.5
transmit 'Equipment 'tt.3' 'tt.6
transmit ''
return
sendmessage:
transmit '\n1\c6[\c1Send A Message\c6]'
aks='\n1\c3To whom is this message addressed(or ALL)? \c7'
call askq
upper an
if an='' then signal computermain
if an='ALL' then do;tt.1=an;x='1ALL';signal sendm;end
if an=upper(pl.ur.1) | left(an,1)='.' then do
transmit '\n1\c2Are you feeling ok?'
signal computermain
end
x=0
serloop:
x=x+1
if x=ur then signal serloop
if x=41 then do
transmit '\n1\c2User Not Found.'
signal computermain
end
a=length(an)
bo=left(pl.x.1,a)
if upper(bo)=an then do
transmit '\n1\c5User Found.'
tt.1=trim(pl.x.1)
signal sendm
end
signal serloop
sendm:
aks='\n1\c4Send a message to 'tt.1' [\c1N\c4]? \c7'
call askq
upper an
if an='' then signal computermain
if an='Y' then signal sm2
signal computermain
sm2:
tt.2='';tt.3='';tt.4='';tt.5='';tt.6=''
number=x
transmit '\n1 [----------------------------------------]'
aks='Title '
call askq
if an='' then signal computermain
tt.1=an
transmit '\n1You have up to 5 lines (blank line will save message).\n1'
query
an=result
tt.2=an
if an='###PANIC' then signal end2
if an='' then signal sve
query
an=result
tt.3=an
if an='###PANIC' then signal end2
if an='' then signal sve
query
an=result
tt.4=an
if an='###PANIC' then signal end2
if an='' then signal sve
query
an=result
tt.5=an
if an='###PANIC' then signal end2
if an='' then signal sve
query
an=result
tt.6=an
if an='###PANIC' then signal end2
sve:
if exists(PF''number'.msg') then do
call open file, (PF''number'.msg'), 'A'
signal sve2
end
call open file, (PF''number'.msg'), 'W'
sve2:
tt.1=left(tt.1,40)
tt.2=left(tt.2,78)
tt.3=left(tt.3,78)
tt.4=left(tt.4,78)
tt.5=left(tt.5,78)
tt.6=left(tt.6,78)
tt.1=trim(tt.1)
an='\n2Title : 'tt.1' (Private)'
if right(number,3) = 'ALL' then do
an='\n2Title : 'tt.1' (To All)'
end
call writeln file, an
an='Player : 'pl.ur.1
call writeln file, an
an='Date/Time: '||date('u')||' / '||time()
call writeln file, an
an='--------------------------------------'
call writeln file, an
tt.2=trim(tt.2)
call writeln file, tt.2
tt.3=trim(tt.3)
call writeln file, tt.3
tt.4=trim(tt.4)
call writeln file, tt.4
tt.5=trim(tt.5)
call writeln file, tt.5
tt.6=trim(tt.6)
call writeln file, tt.6
call writeln file, '\n1End of Message. Press Return.\i1'
call close file
transmit '\n1Message Sent.'
drop tt
signal computermain
findfight:
transmit '\n1\c1[\c4Locate All Of Your Fighters\c1]\c3\n1'
xon=0
x=0
call ldftr
ff1:
x=x+1
if x>y then do
if xon=0 then transmit '\c2No Fighters!'
signal computermain
end
if word(pd.x,1)=serialn then do
an=word(pd.x,2)
z=word(pd.x,3)
xon=1
transmit '\n1\c5Sector :\c7 '||an
transmit '\c5Fighters: \c7'||z
end
signal ff1
scan:
transmit '\n1\c7[\c5Scan Adjacent Sector\c7]'
z=sector
sendstring '\n1\c3Warps lead to 'sdt.3
if sdt.4 ~= '' then sendstring ', 'sdt.4
if sdt.5 ~= '' then sendstring ', 'sdt.5
if sdt.6 ~= '' then sendstring ', 'sdt.6
if sdt.21 ~= '' then sendstring ', 'sdt.21
if sdt.22 ~= '' then sendstring ', 'sdt.22
aks='\n1Scan which? '
query aks
an=result
an=strip(an)
if an='###PANIC' then do
sector=z
call sectordata
signal end2
end
if an='' then do
sector=z
call sectordata
signal computermain
end
x=an
if x=0 then x=1000000
if left(x,1)='0' then x=1000000
if x=sdt.3 | x=sdt.4 | x=sdt.5 | x=sdt.6 | x=sdt.21 | x=sdt.22 then do
sector=x
call ds
transmit ''
sector=z
call sectordata
signal computermain
end
transmit "\n1\c2Can't you read? It says ADJACENT sectors!"
sector=z
signal computermain
attackf:
transmit '\n1\c6[\c1You are being attacked!\c6]'
attackf1:
transmit '\n1\c4Theirs \c1= \c7'sd.8
transmit '\c4Yours \c1= \c7'pl.ur.3
aks='\n1\c1[\c4A\c1]ttack or [\c4E\c1]scape? \c3'
call askq
upper an
if an='A' then signal attackf2
if an='E' then signal escape
signal attackf1
escape:
x=random(0,2,time('s'))
if x=0 then do
transmit "\n1\c2You didn't escape!"
x=pl.ur.3
xt=x/2
y=random(0,x-xt,time('s'))
x=x-y
pl.ur.3=x
transmit '\c5You lost \c7'y' \c5fighters in this process.'
if pl.ur.3=0 then signal dead
signal attackf
end
transmit '\n1\c5You escaped!'
sector=ls
call ds
signal mainmenu
attackf2:
if pl.ur.3=0 then signal dead
transmit '\n1You have 'pl.ur.3' fighters.'
aks='Use how many fighters [0]? '
call askq
if an='' then signal attackf1
f=0
a=an
bo=sd.8
z=pl.ur.3
if a<1 | a>pl.ur.3 then signal attackf2
z=z-a
pl.ur.3=z
attackloopf:
do until a<1 | bo<1
c=random(0,1,time('s'))
if c=0 then a=a-1
if c=1 then do
bo=bo-1
f=f+1
end
if a<=0 then do
transmit '\n1\c2You lost your fighters!'
signal finishupf
end
if bo<=0 then do
transmit '\n1\c5You won!'
signal winnerf
end
end
finishupf:
z=sd.8-bo
sd.8=bo
signal fightfend
winnerf:
z=sd.8-bo
sd.8=0
y=pl.ur.3
y=y+a
pl.ur.3=y
fightfend:
if sd.9=99 then do
y=z*c.2
x=pl.ur.12
x=x+y
pl.ur.12=x
if z>0 then do
transmit '\n1\c1You collected 'y' credits for destroying 'z' Cabal.'
if exists(PF'cabal') then do
call open file, (PF'cabal'), 'R'
y=readln(file)
z=z+y
call close file
end
call open file, (PF'cabal'), 'W'
call writeln file, z
call close file
end
end
if sd.9 ~= 99 then do
temp=sd.9
if z>1 then do
a=pl.ur.1' destroyed 'z' fighters belonging to 'trim(pl.temp.1)
call newspaperopen
if sd.8= 0 then sd.9=0
end
end
x=sd.9
call ws
if sd.8>0 then signal attackf1
signal mainmenu
dead:
transmit "\n1\c2You're history buddy!"
a=trim(pl.ur.1)' was killed by an enemy!'
call newspaperopen
pl.ur.3=0
pl.ur.4=0
pl.ur.7=0
pl.ur.6=date('u')
pl.ur.14=date('c')
x=ur
call saveuser
signal end
port:
if upper(sdt.1)='NONE' then do
transmit '\n1\c2Are you seeing things? There is no port in this sector!'
signal mainmenu
end
transmit '\n1\c6[\c1Port and Trade\c6]'
transmit '\n1\c2*Deducting One Turn For Docking*'
turns=turns-1
transmit '\c2*You have \c1'turns' \c2turns left*'
transmit '\n1\c6Docked In : \c1'sdt.1' ['date' / 'time()']'
if pl.ur.7='' then pl.ur.7=0
if pl.ur.8='' then pl.ur.8=0
if pl.ur.9='' then pl.ur.9=0
if pl.ur.10='' then pl.ur.10=0
if right(sdt.2,1)=0 then signal clss0
signal clss123
clss0:
if sd.23 ~= date then do
x=random(0,20,time('s')) + 90
sd.18=x
x=random(0,30,time('s')) + 485
sd.19=x
x=random(0,40,time('s')) + 280
sd.20=x
sd.23=date
call ws
end
transmit '\n1\c5Cargo holds \c2: \c7'sd.19' \c5credits/hold'
transmit '\c5Fighters \c2: \c7'sd.18' \c5credits/fighter'
transmit '\c5Turns \c2: \c7'sd.20' \c5credits/turns'
transmit '\c5Mines \c2: \c74,000 \c5credits each'
tt.1='holds';z=7;temp=sd.19;call buy0p
tt.1='fighters';z=3;temp=sd.18;call buy0p
tt.1='turns';z=5;temp=sd.20;call buy0p
tt.1='mines';z=11;temp=4000;call buy0p
signal mainmenu
buy0p:
transmit '\n1('pl.ur.12' credits)'
xon=pl.ur.12 / temp
xon=xon+0.001
if z=7 then do
if 60-pl.ur.7<xon then xon=60-pl.ur.7+0.001
end
xon=trunc(xon)
aks='\c4How many 'tt.1' do you wish to buy (\c1'xon' = max\c4) [\c10\c4]? \c3'
call askq
if an='' | an<1 then return
if datatype(an)~='NUM' then signal buy0p
y=an+pl.ur.z
if an>xon then signal buy0p
xon=temp*an
if z ~= 5 then do
pl.ur.z=pl.ur.z+an
end
if z=5 then do
turns=turns+an
end
pl.ur.12=pl.ur.12-xon
return
clss123:
call portstat
x=sd.2
if x=1 then do
call bore
call bequ
call sorg
end
if x=2 then do
call borg
call bequ
call sore
end
if x=3 then do
call borg
call bore
call sequ
end
sd.23=date()
call ws
signal mainmenu
buysell:
if typeb=0 then do
temp=comm+7
typec=pl.ur.temp
end
if typeb=1 then do
temp=pl.ur.8+pl.ur.9+pl.ur.10
typec=pl.ur.7-temp
if typec<=0 then signal osend
end
if typec=0 & typeb ~= 1 then signal osend
os2:
temp=comp+8
y=sd.temp
transmit ''
ab='buying'
if typeb>0 then ab='selling'
comms='Ore'
if comm=2 then comms='Organics'
if comm=3 then comms='Equipment'
transmit 'We are 'ab' 'y' units of 'comms
ab='Sell'
if typeb>0 then ab='Buy'
if typec>y then typec=y
sendstring ab' how many ['typec']? '
query ''
an=result
if an='###PANIC' then signal end2
ab=an
if an='' then ab=typec
if ab=0 then signal osend
if ab<1 | ab>typec then signal os2
d=1
typet=comp+9
bo=ab*typet
e=bo*.07%1
if typeb=0 then e=e+bo
if typeb>0 then e=bo-e
haggleorg:
if d>1 & typeb ~= 1 then do
tt.1=ab*typet
temp=e-tt.1
temp=(temp/3)%1
bo=bo+temp
end
if d>1 & typeb>0 then do
tt.1=ab*typet
temp=tt.1-e
temp=(temp/3)%1
bo=bo-temp
end
if d=4 then do
transmit 'Forget it! Go Away!'
signal osend
end
ho2:
transmit ''
a='We will buy them for 'bo' credits.'
if typeb>0 then a='We will sell them for 'bo' credits.'
transmit a
aks='Your offer? '
call askq
if an>pl.ur.12 & typeb=1 then do
transmit '\n1You don''t have that much!'
transmit 'You have 'pl.ur.12' credits.'
signal ho2
end
if an='' then do
signal ho2
end
if an=0 then signal osend
if typeb=0 then do
if an<=bo | an<=e then do
bo=an
signal orgdeal
end
end
if typeb>0 then do
if an>=bo | an>=e then do
bo=an
signal orgdeal
end
end
transmit '\n1Ha Ha! I don''t think so!'
d=d+1
signal haggleorg
orgdeal:
if typeb>0 then signal orgdeal2
transmit '\n1Agreed!'
y=pl.ur.12
y=y+bo
pl.ur.12=y
temp=comp+8
y=sd.temp
y=y-ab
sd.temp=y
temp=comm+7
y=pl.ur.temp
y=y-ab
pl.ur.temp=y
signal osend
orgdeal2:
transmit '\n1Ok! Sure!'
y=pl.ur.12
y=y-bo
pl.ur.12=y
temp=comm+7
y=pl.ur.temp
y=y+ab
pl.ur.temp=y
temp=comp+8
y=sd.temp
y=y-ab
sd.temp=y
osend:
return
change:
if sd.23 ~=date() then do
y=y+100
if y>750 then y=750
end
x=750/y
x=x+z
x=x%1
return
change2:
if sd.23 ~=date() then do
tt.4=.12*y
y=y+tt.4
y=y%1
if y>1000 then y=1000
end
x=(y/1000)*z
x=x+z
x=x%1
return
sorg:
y=sd.10
z=20
call change
sd.10=y
sd.11=x
typeb=1
comm=2
comp=2
call buysell
return
sore:
y=sd.12
z=10
call change
sd.12=y
sd.13=x
typeb=1
comm=1
comp=4
call buysell
return
sequ:
y=sd.14
z=30
call change
sd.14=y
sd.15=x
typeb=1
comm=3
comp=6
call buysell
return
borg:
y=sd.10
z=20
call change2
sd.10=y
sd.11=x
typeb=0
comm=2
comp=2
call buysell
return
bore:
y=sd.12
z=10
call change2
sd.12=y
sd.13=x
typeb=0
comm=1
comp=4
call buysell
return
bequ:
y=sd.14
z=30
call change2
sd.14=y
sd.15=x
typeb=0
comm=3
comp=6
call buysell
return
rankplay:
sendstring '\f1\c4Ranking Players...'
if exists(PF'rank.temp') then do
address command 'delete 'PF'rank.temp'
address command 'delete 'PF'rank'
end
if exists(PF'team.temp') then do
address command 'delete 'PF'team.temp'
address command 'delete 'PF'rankt'
end
call ldftr
call teloop
do x=1 to 10
tt.x=0
end
x=0
call open file, (PF'rank.temp'), 'W'
bo=0
rp2:
x=x+1
if x>40 then do
x=0
call close file
signal rp3
end
u=pl.x.1
if pl.x.2>0 then u=u||' ['pl.x.2']'
if left(u,2)='..' then signal rp2
sendstring '.'
w=0
temp=0
buck=pl.x.3
do i=1 to y
if word(pd.i,1)=pl.x.15 & pl.x.15 ~=0 then do
z=word(pd.i,3)
if z='' then z=0
buck=buck+z
end
end
if buck='' then buck=0
temp=100*buck
w=w+temp
buck=pl.x.7
if buck='' then buck=0
temp=500*buck
w=w+temp
buck=pl.x.11
if buck = '' then buck=0
temp=4000*buck
w=w+temp
if pl.x.12='' then pl.x.12=0
if pl.x.13='' then pl.x.13=0
w=w+pl.x.12
w=w+pl.x.13
if pl.x.4=0 then w=0
temp=right(w,9,'0')
if pl.x.4=0 then temp=' Dead'
a=temp' 'u
call writeln file, a
if pl.x.2>0 then do
bo=1
teamnumber=pl.x.2
if pl.x.4 ~= 0 then do
tt.teamnumber=tt.teamnumber+w
end
end
signal rp2
rp3:
if bo=1 then do
call open file, (PF'team.temp'), 'W'
do x=1 to 10
if tt.x>0 then do
an=right(tt.x,9,'0')' ['|| x ||'] 'tn.x
call writeln file, an
end
end
call close file
address command 'sort 'PF'team.temp 'PF'rankt'
end
address command 'sort 'PF'rank.temp 'PF'rank'
rp4:
transmit '\f1\c3## Value Name [Team]'
transmit '\c1--------------------------------------\c7'
call open file, (PF'rank'), 'R'
x=0
call rp5
transmit '\n1\c3## Value Team'
transmit '\c1--------------------------------------\c7'
if exists(PF'rankt') then do
call open file, (PF'rankt'), 'R'
x=0
call rp5
end
drop i. bo. x. y. u. z. buck. w. temp. a. tt. pd. tn. tle. tpd.
signal computermain
rp5:
x=x+1
if ~eof(file) then do
tt.x=readln(file)
signal rp5
end
call close file
temp=0
y=x-1
rp6:
y=y-1
if y=0 then return
temp=temp+1
u=left(tt.y,9)
if u ~= ' Dead' then do
u=u/1
end
u=right(u,9,' ')
z=overlay(u,tt.y)
w=right(temp,2,' ')
transmit w' 'z
signal rp6
team:
transmit '\n1\c6[\c1Team Menu\c6]'
ldteams=1
team2:
if ldteams=1 then call teloop
sendstring '\n1\c4(C,D,F,J,L,M,N,P,Q,R,S,X,?)? \c7'
call ask
if an='###PANIC' then signal end2
if an='Q' then do
drop tn tle tpd tt y x fle
signal mainmenu
end
if an='M' then signal createt
if an='J' then signal joint
if an='X' then signal quitt
if an='C' then do;tt.1='Credits';y=12;signal casht;end
if an='F' then do;tt.1='Fighters';y=3;signal casht;end
if an='S' then signal seart
if an='L' then signal trant
if an='P' then do;tt.1='Password';y=0;signal chant;end
if an='D' then signal rant
if an='N' then do;tt.1='Name';y=1;signal chant;end
if an='R' then signal kick
if an='?' then do
sendfile PF'team.help'
signal team2
end
signal team2
teloop:
x=0
teloop2:
x=x+1
if x>10 then return
fle=PFT't' x
call open file, (fle), 'R'
tn.x=readln(file)
tle.x=readln(file)
tpd.x=readln(file)
call close file
ldteams=0
signal teloop2
createt:
transmit '\n1\c6[\c1Create A New Team\c6]\n1'
if pl.ur.2>0 then do
transmit '\n1\c2You MUST quit the team you are on to create a new team.'
signal team2
end
transmit '\c4Searching for an open team slot\c1...'
x=0
createt2:
x=x+1
if x>10 then do
transmit '\n1\c2Sorry, there are no spaces available.'
transmit 'Please join a team or try again later.'
signal team2
end
if tn.x='..' then do
ftem=x
signal fouteam
end
signal createt2
fouteam:
transmit '\n1\c3Team \c1'ftem' \c3is available.\n1'
sendstring '\c7Please enter a name for your team\n1: \c1'
query
an=result
if an='###PANIC' then signal end2
if an='' then signal team2
tn.ftem=an
sendstring '\n1\c7Please enter a password for your team\n1: \c1'
query
an=upper(result)
if an='###PANIC' then signal end2
if an='' then signal team2
tpd.ftem=an
transmit '\n1\c4Creating team file\c1...'
pl.ur.2=ftem
fle=PFT't' ftem
call open file, (fle), 'W'
call writeln file, tn.ftem
call writeln file, pl.ur.1
call writeln file, tpd.ftem
call close file
transmit '\c5Team created!'
a=pl.ur.1' created a team named 'tn.ftem' ['ftem']'
call newspaperopen
ldteams=1
signal team2
joint:
transmit '\n1\c6[\c1Join A Team\c6]\n1'
if pl.ur.2>0 then do
transmit '\c2You MUST quit the team you are on first.'
signal team2
end
transmit '\c7Current Team List:\c3'
x=0
do x=1 to 10
if tn.x ~= '..' then do
transmit 'Team #' x ' Name: ' tn.x
transmit 'Leader: 'tle.x
transmit ''
end
end
sendstring '\n1\c7What team do you want to join? \c1'
query
an=upper(result)
if an='###PANIC' then signal end2
if an='' then signal team2
if an<1 | an>10 then signal team2
if tn.an='..' then do
transmit '\n1\c2Does that look like a team to you?'
signal team2
end
teamnumber=an
passtest=upper(tpd.teamnumber)
sendstring '\n1\c4Password? \c1'
query
an=upper(result)
if an='' then signal team2
if an='###PANIC' then call end2
if an=passtest then do
pl.ur.2=teamnumber
transmit '\c7You are now a member of team number 'teamnumber
a=pl.ur.1' joined team #'teamnumber
call newspaperopen
signal team2
end
transmit "\n1\c2Sorry. That wasn't the password"
signal team2
quitt:
transmit '\n1\c6[\c1Quit Team\c6]\n1'
sendstring '\c5Do you really want to quit your team? \c7'
call ask
if an='Y' then do
teamnumber=pl.ur.2
if tle.teamnumber=pl.ur.1 then do;x=ur;signal disband2;end
pl.ur.2=0
transmit '\n1\c2You are no longer in a team.'
a=pl.ur.1' quit team #'teamnumber
signal team2
end
signal team2
rant:
transmit '\n1\c6[\c1Disband Team\c6]\n1'
teamnumber=pl.ur.2
if tle.teamnumber ~= pl.ur.1 then do
transmit '\c2You are not the captain of that team!'
signal team2
end
sendstring '\c4Do you really want to disband? \c1'
call ask
if an='Y' then do
signal disband2
end
signal team2
x=ur
disband2:
teamnumber=pl.x.2
transmit '\n1\c5Disbanding team. Please wait while members are purged.'
x=0
do x=1 to 40
if pl.x.2=teamnumber then do
pl.x.2=0
call saveuser
end
end
a=tn.teamnumber' disbanded.'
call newspaperopen
tn.teamnumber='..'
call saveteam
ldteams=1
transmit '\c3Team disbanded.'
if capkill=1 then return
signal team2
casht:
transmit '\n1\c6[\c1Transfer 'tt.1'\c6]\n1'
if pl.ur.2=0 then do
transmit '\c1You are not on a team!'
signal team2
end
sendstring '\c4Do you want to send 'tt.1'? \c7'
call ask
if an='Y' then signal casht2
signal team2
casht2:
transmit '\n1\c2Checking sector\c1...'
x=0
casht3:
x=x+1
if x>40 then signal casht4
if x=ur then signal casht3
if pl.x.4=sector & pl.x.2=pl.ur.2 then do
sendstring '\n1\c3Transfer 'tt.1' to 'pl.x.1'? '
call ask
if an='Y' then do
transmit 'You have 'pl.ur.y' 'tt.1' available for transfer.'
sendstring 'How much? '
query
an=result
if an='###PANIC' then call end2
if an>0 & an<=pl.ur.y then do
pl.ur.y=pl.ur.y-an
pl.x.y=pl.x.y+an
call saveuser
hap=pl.ur.1' gave you '||an||' '||tt.1'.'
call hapopen
transmit tt.1' transferred.'
signal casht3
end
end
end
signal casht3
casht4:
signal team2
seart:
transmit '\n1\c6[\c1Search For Other Team Members\c6]\n1'
transmit '\c2Searching\c1...\c3'
x=0
seart2:
x=x+1
if x>40 then signal seart3
if x=ur then signal seart2
if pl.x.2=0 then signal seart2
if pl.x.2=pl.ur.2 then do
sendstring '\n1Name : 'pl.x.1
if pl.x.4 = 0 then do
transmit ' \c2(Dead)'
signal seart2
end
transmit '\n1\c2Sector : 'pl.x.4
transmit 'Fighters: 'pl.x.3
transmit 'TCredits: 'pl.x.12
transmit ''
end
signal seart2
seart3:
transmit '\n1\c2Search Complete.'
signal team2
trant:
transmit '\n1\c6[\c1List Teams And Members\c6]\n1'
x=0
trant2:
x=x+1
if x>10 then signal trant4
if left(tn.x,2) ~= '..' then do
transmit '\n1\c3Team' x ' '
transmit 'Name : 'tn.x
transmit 'Leader : 'tle.x
transmit 'Members: '
do y=1 to 40
if pl.y.2=x then do
if pl.y.1 ~= tle.x then transmit ' 'pl.y.1
end
end
end
signal trant2
trant4:
transmit '\n1\c2List Complete.'
signal team2
chant:
transmit '\n1\c6[\c1Change Team 'tt.1'\c6]\n1'
teamnumber=pl.ur.2
tt.2=tpd.teamnumber
if y=1 then tt.2=tn.teamnumber
if pl.ur.1 ~= tle.teamnumber then do
transmit '\c2You are not the captain of the team!'
signal team2
end
transmit '\c3The current 'tt.1' is 'tt.2
sendstring 'The new 'tt.1' is: '
query
an=result
if y=0 then upper an
if an='' then signal team2
if an='###PANIC' then signal end2
if y=0 then tpd.teamnumber=an
if y=1 then tn.teamnumber=an
call saveteam
transmit '\n1'tt.1' Changed.'
signal team2
saveteam:
fle=PFT't 'teamnumber
call open file, (fle), 'W'
call writeln file, tn.teamnumber
call writeln file, tle.teamnumber
call writeln file, tpd.teamnumber
call close file
return
kick:
transmit '\n1\c6[\c1Remove Team Member\c6]\n1\c1'
teamnumber=pl.ur.2
if pl.ur.1 ~= tle.teamnumber then do
transmit '\c2You are not the captain of the team!'
signal team2
end
x=0
kick2:
x=x+1
if x>40 then signal kick3
if x=ur then signal kick2
if pl.x.2=pl.ur.2 then do
transmit 'Player #'||x||' Name: '||trim(pl.x.1)
end
signal kick2
kick3:
aks='\n1Remove which member? '
call askq
if an='' then signal team2
if pl.an.2 ~= pl.ur.2 then do
transmit '\n1He is not a member of your team!'
signal team2
end
pl.an.2=0
x=an
call saveuser
hap='You were removed from team 'teamnumber
call hapopen
transmit '\c1'||pl.x.1||' removed from your team.'
transmit 'You should now change your team password if you haven''t already.'
signal team2
createp:
transmit '\n1\c4There is no planet in this sector.'
sendstring '\c5Do you wish to create one for 10,000 credits (y/N)? '
call ask
if an='Y' then signal createp2
signal mainmenu
createp2:
if pl.ur.12<10000 then do
transmit '\n1\c1You do not have enough trading credits!'
signal mainmenu
end
aks='\n1\c3Please enter a name for your planet: '
call askq
if an='' then signal mainmenu
if left(an,2)='..' then signal mainmenu
sd.26=an
pw=''
pl.ur.12=pl.ur.12-10000
call ws
transmit '\n1\c6Creating planet...'
fle=PFW||sector||'.tw'
call open file, (fle), 'W'
temp=trim(pl.ur.1)
call writeln file, temp
call writeln file, '1'
call writeln file, '1'
call writeln file, '1'
call writeln file, '1'
call writeln file, '1'
call writeln file, '1'
call writeln file, date('C')
call writeln file, '0'
call writeln file, '0'
call writeln file, pw
call writeln file, '10'
call writeln file, '20'
call writeln file, '30'
call close file
transmit '\n1TerraForming Completed.'
transmit '\c1Who do you think you are? God, perhaps?'
a=trim(pl.ur.1)||' created a planet somewhere...'
call newspaperopen
signal mainmenu
land:
transmit '\n1\c6[\c1Land On Planet\c6]\c3\n1'
if left(sd.26,2)='..' then signal createp
if sd.26='' then signal createp
fle=PFW||sector||'.tw'
call open file, (fle), 'R'
do x=1 to 14
pd.x=readln(file)
end
call close file
transmit '*Deducting One Turn For Landing*'
turns=turns-1
call updatep
call planetreport
signal planetmain
plansave:
fle=PFW||sector||'.tw'
call open file, (fle), 'W'
do x=1 to 14
call writeln file, pd.x
end
call close file
return
updatep:
if pd.8=date('c') then return
an=date('c')-pd.8
if an=0 then return
transmit '\c4Last landing was \c1'an'\c4 days ago.'
temp=pd.2*an
pd.3=pd.3+temp
temp=pd.4*an
pd.5=pd.5+temp
temp=pd.6*an
pd.7=pd.7+temp
pd.8=date('c')
return
planetreport:
transmit '\n1\c6Planet: \c1'sd.26
transmit '\n1Commodity Prod. Amount In Holds'
transmit '=================================='
tt.1=center(pd.2,5,' ');tt.2=center(pd.3,6,' ');tt.3=center(pl.ur.9,8,' ')
transmit 'Organics 'tt.1' 'tt.2' 'tt.3
tt.1=center(pd.4,5,' ');tt.2=center(pd.5,6,' ');tt.3=center(pl.ur.8,8,' ')
transmit 'Ore 'tt.1' 'tt.2' 'tt.3
tt.1=center(pd.6,5,' ');tt.2=center(pd.7,6,' ');tt.3=center(pl.ur.10,8,' ')
transmit 'Equipment 'tt.1' 'tt.2' 'tt.3
an=pl.ur.7-pl.ur.8-pl.ur.9-pl.ur.10
transmit '\n1\c4You have \c1'an'\c4 free cargo holds.'
return
planetmain:
sendstring '\n1\c6'sd.26': '
call ask
if an='' then signal planetmain
if an='###PANIC' then signal end2
if an='1' then do;number=3;call takecom;signal planetmain;end
if an='2' then do;number=5;call takecom;signal planetmain;end
if an='3' then do;number=7;call takecom;signal planetmain;end
if an='A' then signal takeall
if an='L' then signal leave
if an='D' then signal destroy
if an='I' then signal increase
if an='R' then do;call planetreport;signal planetmain;end
if an='?' then do
sendfile PF'planet.help'
end
signal planetmain
takecom:
y=pl.ur.7-pl.ur.8-pl.ur.9-pl.ur.10
if y=0 then do
transmit '\c1You have no free holds!'
z=1
return
end
if number=3 then do;x=9;tt.1='Organics';end
if number=5 then do;x=8;tt.1='Ore';end
if number=7 then do;x=10;tt.1='Equipment';end
transmit '\n1\c5You have 'y' free holds.'
if pd.number=0 then do
transmit '\c1No units available!'
return
end
if pd.number<y then do
pl.ur.x=pl.ur.x+pd.number
transmit '\c1You collected 'pd.number' units of 'tt.1'.'
pd.number=0
return
end
if pd.number=y | pd.number>y then do
pl.ur.x=pl.ur.x+y
pd.number=pd.number-y
transmit '\c1You collected 'y' units of 'tt.1'.'
return
end
return
takeall:
number=3
call takecom
if z=1 then signal planetmain
number=5
call takecom
if z=1 then signal planetmain
number=7
call takecom
signal planetmain
leave:
call plansave
drop tt pd
signal mainmenu
increase:
transmit '\n1\c2Increase Which One?'
transmit '\c6[\c11\c6] \c3 Organics'
transmit '\c6[\c12\c6] \c3 Ore'
transmit '\c6[\c13\c6] \c3 Equipment'
bufferflush
aks='\n1\c4: '
call askq
if an='' then signal planetmain
number=0
if an=1 then do;number=2;x=200;tt.1='Organics';end
if an=2 then do;number=4;x=400;tt.1='Ore';end
if an=3 then do;number=6;x=700;tt.1='Equipment';end
if number=0 then signal planetmain
if pd.number=20 then do
transmit '\c1Production is limited to 20 units per day!'
signal planetmain
end
sendstring '\c6It will cost \c1'||x||'\c6 credits per unit to increase'
transmit ' \c1'tt.1'\c6 production.'
transmit 'You have \c1'pl.ur.12'\c6 trading credits.'
z=20-pd.number
aks='Increase by how many units (\c1'z'\c6 = max)? '
call askq
if an='' then signal planetmain
if an<1 | an>z then signal increase
if an*x>pl.ur.12 then do
transmit '\c1You do not have enough trading credits!'
signal increase
end
temp=an*x
pl.ur.12=pl.ur.12-temp
pd.number=pd.number+an
transmit tt.1' production is now at '||pd.number||' units per day.'
signal planetmain
destroy:
bufferflush
sendstring '\n1\c2Do you really want to destroy this lovely planet? '
call ask
if an='Y' then signal destroy2
signal planetmain
destroy2:
transmit '\c2Planetary defense attacks...'
x=random(1,50,time('s'))
if x>pl.ur.3 then x=pl.ur.3
if x=pl.ur.3 then do
transmit '\n1They were too strong for you!'
signal dead
end
transmit '\c6You lost \c1'||x||'\c6 fighters.'
pl.ur.3=pl.ur.3-x
transmit
transmit '\c6You destroyed \c1'sd.26'\c6. Are you happy?'
a=pl.ur.1' destroyed a planet named 'sd.26
call newspaperopen
sd.26 = '....................'
call ws
if exists(PFW||sector||'.tw') then do
address command 'delete 'PFW||sector||'.tw'
end
signal mainmenu
ask:
bufferflush
getchar
an=upper(result)
if an='###PANIC' then signal end2
transmit an
return
askq:
bufferflush
query aks
an=result
an=strip(an)
if an='###PANIC' then signal end2
return
ldftr:
if ~exists(PFU'fighters') then do
y=0
return
end
call open file, (PFU'fighters'), 'R'
y=0
do until eof(file)
y=y+1
pd.y=readln(file)
end
call close file
return